package com.sff.events {
	
	import flash.events.Event;	import flash.events.StatusEvent;		public class LoaderStatusEvent extends StatusEvent {
		
		private var _messages : Array;
		
		public function LoaderStatusEvent (type : String, message : String = null ,baseStatus : Array = null, level : String = "status" ) {
			var superStatus : String = (baseStatus != null ) ? baseStatus[0] : message;
			
			super( type, false, false, superStatus , level );
			
			if( message != null ) {
				if( baseStatus != null ) {
					_messages = baseStatus.concat( message );
				} else {
					_messages = new Array( message );
				}
			} else {
				if( baseStatus != null ) {
					_messages = baseStatus.concat( message );
				}
				else {
					throw new ArgumentError("Both message and baseStatus can not null.");
				}
			}
		}

		public function get messages() : Array {
			return _messages;	
		}
		
		override public function clone () : Event {
			return new LoaderStatusEvent (type, null, _messages );
		}		
	}
}
